using System.Activities;
using System.Activities.Statements;
using Headsight.BPMN2WF.Testing.TestObjCtors;
using Headsight.BPMN2WF.Transformation;
using Headsight.BPMN2WF.Utils;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Headsight.BPMN2WF.WF.Simplification
{
    [TestClass]
    public abstract class WFSimplifier_TestFixture<T> where T : IWFSimplifier
    {
        protected T _sut;
        protected IBPMN2WFTransformationContext _ctx;
        protected Activity _activity1;
        protected Activity _activity2;
        protected Activity _activity3;


        [TestInitialize]
        public void SetUpTestFixture()
        {
            _activity1 = new If();
            _activity2 = new Throw();
            _activity3 = new Flowchart();

            _ctx = new BPMN2WFTransformationContextCtor().Create();
            
            _sut = CreateSut();
        }

        protected static Sequence CreateSequence(params Activity[] activities)
        {
            var result = new Sequence();

            foreach (var activity in activities)
                result.Activities.Add(activity);

            return result;
        }

        protected abstract T CreateSut();
    }
}